package com.jbp.job;

import com.jbp.redis.RedisConfigService;
import com.jbp.service.UnionUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 工会任务
 * */
@Component
@Configuration
public class UnionerJob {
    @Autowired
    private UnionUserService unionUserService;

    @Autowired
    private RedisConfigService redisConfigService;
    /**
     * 自动审核退出
     * */
    @Scheduled(fixedDelay = 1000*10)
    public void setData(){
        if (redisConfigService.setLock("unioner_auto_audit", 60)) {
            unionUserService.autoQuitUnion();
        }
    }

}

